package database

import (
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/sqlite"
)

var db *gorm.DB

var err error

func InitGorm() (*gorm.DB, error) {
	//db, err = gorm.Open("mysql", "root:Zhao5220655@/test?charset=utf8")
	db, err = gorm.Open("sqlite3", "./test.db")

	if err != nil {
		return &gorm.DB{}, err
	}
	//db.AutoMigrate(store.User{})
	return db, nil
}
